<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/main.css"/>
    <script src="/layui/layui.js"></script>
    <script src="/js/jquery.1.8.3.min.js"></script>
    <link type="text/css" rel="styleSheet" href="/css/customer_search.css"/>
</head>
<body>

<div th:include="/common/head :: head"></div>

<div class="content">

    <div class="page_search">
        <div class="layui-tab layui-tab-card" style="height: max-content">
            <div style="font-weight: bolder;">我的快递列表：</div>
            <hr>
            <div style=" background-color: #F2F2F2;">
                <div class="layui-card-body">
                    <div>
                        <table class="layui-table" id="LAY_table_user" lay-filter="user">
                            <th>快递号</th>
                            <th>发送人</th>
                            <th>接收人</th>
                            <th>创建时间</th>
                            <th>状态</th>
                            <th>详情查看</th>
                            <tr th:each="item: ${aPackageList}">
                                <td th:value="${item.getId()}" th:text="${item.getNo()}"></td>
                                <td th:value="${item.getId()}" th:text="${item.getSendName()}"></td>
                                <td th:value="${item.getId()}" th:text="${item.getReceiptName()}"></td>
                                <td th:value="${item.getId()}" th:text="${item.getCreateTime()}"></td>
                                <td th:value="${item.getId()}">
                                    <p class="text" th:if="${item.getState()} eq '1'">待快递员取件</p>
                                    <p class="text" th:if="${item.getState()} eq '2'">运输中</p>
                                    <p class="text" th:if="${item.getState()} eq '3'">派件中</p>
                                    <p class="text" th:if="${item.getState()} eq '-1'">订单取消</p>
                                    <p class="text" th:if="${item.getState()} eq '-2'">取件失败</p>
                                    <p class="text" th:if="${item.getState()} eq '-3'">派送失败</p>
                                    <p class="text" th:if="${item.getState()} eq '0'">派件成功</p>
                                </td>
                                <td th:value="${item.getId()}"><a
                                        th:href="@{/customer/searchPackageByPNo(pno=${item.getNo()})}">查看详情</a></td>
                            </tr>
                        </table>
                    </div>
                </div>
                <form style="padding-top: 30px;padding-right: 50px;" class="layui-form" action="">
                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <input type="hidden" id="p_id">
                            <button type="button" class="layui-btn layui-btn backlist">返回快递列表</button>
                            <button type="button" class="layui-btn layui-btn backindex">去主页面</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<div th:include="/common/footer :: footer"></div>


<script>
    $(".backindex").click(function () {
        location.href = "/customer/index"
    });
    $(".backlist").click(function () {
        location.href = "/customer/search"
    });
</script>
</body>
</html>